package com.wish.finance.controller;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wish.common.core.web.domain.AjaxResult;
import com.wish.finance.entity.CwClearing;
import com.wish.finance.entity.vo.ClearingVo;
import com.wish.finance.service.ICwClearingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 结算表 前端控制器
 * </p>
 *
 * @author 
 * @since 2022-03-28
 */
@RestController
@RequestMapping("/cw-clearing")
public class CwClearingController {

    @Autowired
    ICwClearingService cwClearingService;

    @PostMapping("list")
    public AjaxResult list(@RequestBody ClearingVo clearingVo){
        PageHelper.startPage(clearingVo.getPageNum(), clearingVo.getSize());
        List<CwClearing> list = cwClearingService.clearlist(clearingVo);
        PageInfo<CwClearing> pg = new PageInfo<>(list);
        return AjaxResult.success(pg);
    }






}
